package com.lingz.manager.modules.wuxue.controller;


import com.lingz.manager.common.utils.ResultUtil;
import com.lingz.manager.common.vo.Result;
import com.lingz.manager.modules.wuxue.entity.WaterDeviceInfo;
import com.lingz.manager.modules.wuxue.entity.YikemanData;
import com.lingz.manager.modules.wuxue.service.WaterDeviceInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

/**
 * (WaterDeviceInfo)表控制层
 *
 * @author makejava
 * @since 2023-12-08 10:23:00
 */
@Slf4j
@RestController
@Api(description = "水利设备元信息管理接口")
@RequestMapping("/wuxue/waterDeviceInfo")
@Transactional
public class WaterDeviceInfoController{

    @Resource
    private WaterDeviceInfoService waterDeviceInfoService;

    @GetMapping(value = "/requestWaterDeviceInfoDataToDB")
    @ApiOperation(value = "requestWaterDeviceInfoDataToDB")
    public Result<Object> requestWaterDeviceInfoDataToDB(){
        waterDeviceInfoService.requestWaterDeviceInfoDataToDB();
        return new ResultUtil<>().setData("同步成功！");
    }

    @GetMapping("/findWaterDeviceList")
    @ApiOperation("不分页查询水利设备数据")
    public Result<List<WaterDeviceInfo>> findWaterDeviceList() {
        return new ResultUtil<List<WaterDeviceInfo>>().setData(waterDeviceInfoService.findWaterDeviceList());
    }

}

